<?php
namespace app\admin\validate;
use think\Validate;

class ComapplyInfo extends Validate
{
    protected $rule = [
        'com_name' => 'require|max:25',
        'nature' => 'require|max:20',
        'com_province' => 'require|max:15',
        'com_city' => 'require|max:15',
        'com_area' => 'require|max:15',
        'com_address' => 'require|max:50',
        'fixed_phone' => 'require|max:15',
        'com_email' => 'require|email',
        'zczj'=>['require','regex'=>'/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/'],
        'tyxydm' => 'require|length:18',
        'faren_name' => 'require|chs|length:2,5',
        'zzstart_time' => 'require|regex:/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/',
        'zzend_time' => 'require|regex:/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/',
        'jyfw' => 'require|max:100',
        'shop_name' => 'require|unique:shops|length:2,20',
        'shop_desc'=>'require|max:50',
        'indus_id' => ['require','regex'=>'/^\+?[1-9][0-9]*$/'],
        'goods_id'=> 'require',
        'contacts' => 'require|length:2,5',
        'telephone' => 'require|regex:/^1[3456789]\d{9}$/',
        'sfz_num'=>'require|length:18',
        'logo'=>'require',
        'sfzz_pic'=>'require',
        'sfzb_pic'=>'require',
        'frsfz_pic'=>'require',
        'zhizhao'=>'require',
        'pro_id'=>['require','regex'=>'/^\+?[1-9][0-9]*$/'],
        'city_id'=>['require','regex'=>'/^\+?[1-9][0-9]*$/'],
        'area_id'=>['require','regex'=>'/^\+?[1-9][0-9]*$/'],
        'address'=>'require|max:50',
        'latlon'=>'require|max:50',
        'user_id'=>['require','regex'=>'/^\+?[1-9][0-9]*$/'],
    ];

    protected $message = [
        'com_name.require' => '公司名称不能为空',
        'com_name.max' => '公司名称最多25个字符',
        'nature.require' => '公司性质不能为空',
        'nature.max' => '公司性质最多20个字符',
        'com_province.require' => '公司所在省份不能为空',
        'com_province.max' => '公司所在省份最多15个字符',
        'com_city.require' => '公司所在城市不能为空',
        'com_city.max' => '公司所在城市最多15个字符',
        'com_area.require' => '公司所在区县不能为空',
        'com_area.max' => '公司所在区县最多15个字符',
        'com_address.require' => '公司详细地址不能为空',
        'com_address.max' => '公司详细地址最多50个字符',
        'fixed_phone.require' => '公司固定电话不能为空',
        'fixed_phone.max' => '公司固定电话最多15个字符',
        'com_email.require' => '公司邮箱不能为空',
        'com_email.email' => '公司邮箱格式错误',
        'zczj.require' => '注册资金不能为空',
        'zczj.regex' => '注册资金格式错误',
        'tyxydm.require' => '统一社会信用代码不能为空',
        'tyxydm.length' => '统一社会信用代码为18位字符',
        'faren_name.require' => '法人姓名不能为空',
        'faren_name.chs' => '法人姓名只能为汉字',
        'faren_name.length' => '法人姓名只能为2到5个字符',
        'zzstart_time.require' => '营业执照有效期不能为空',
        'zzstart_time.regex' => '营业执照有效期格式错误',
        'zzend_time.require' => '营业执照有效期不能为空',
        'zzend_time.regex' => '营业执照有效期格式错误',
        'jyfw.require' => '经营范围不能为空',
        'jyfw.max' => '经营范围最多100个字符',
        'shop_name.require' => '店铺名称不能为空',
        'shop_name.unique' => '店铺名称已存在',
        'shop_name.length' => '店铺名称只能为2到20个字符',
        'shop_desc.require' => '商铺描述不能为空',
        'shop_desc.max' => '店铺描述最多50个字符',
        'indus_id.require' => '请选择行业',
        'indus_id.regex' => '请选择行业',
        'goods_id.require' => '请选择经营类目信息',
        'contacts.require' => '联系人姓名不能为空',
        'contacts.length' => '联系人姓名只能为2到5个字符',
        'telephone.require' => '手机号不能为空',
        'telephone.regex' => '手机号格式不正确',
        'sfz_num.require' => '身份证号不能为空',
        'sfz_num.length' => '身份证号为18位字符',
        'logo.require' => '请上传店铺logo照片',
        'sfzz_pic.require' => '请上传法人身份证正面照片',
        'sfzb_pic.require' => '请上传法人身份证背面照片',
        'frsfz_pic.require' => '请上传法人手持身份证照片',
        'zhizhao.require' => '请上传营业执照照片',
        'pro_id.require' => '请选择省份',
        'pro_id.regex' => '请选择省份',
        'city_id.require' => '请选择城市',
        'city_id.regex' => '请选择城市',
        'area_id.require' => '请选择区县',
        'area_id.regex' => '请选择区县',
        'address.require' => '商铺详细地址不能为空',
        'address.max' => '商铺详细地址最多50个字符',
        'latlon.require' => '商铺地址坐标不能为空',
        'latlon.max' => '商铺地址坐标最多50个字符',
        'user_id.require' => '请填写用户id',
        'user_id.regex' => '请检查用户id是否正确',
    ];
    

}
